namespace net.podhola.gtd.finances

import System
import net.podhola
import net.podhola.gtd

[Castle.ActiveRecord.ActiveRecord]
class Receipt(Castle.ActiveRecord.ActiveRecordBase of Receipt):
	_id as int	
	[Castle.ActiveRecord.PrimaryKey(Castle.ActiveRecord.PrimaryKeyType.Increment)]
	Id as int:
		get: return _id
		set: _id = value

	_subject as string	
	[Castle.ActiveRecord.Property] 
	Subject as string:
		get: return _subject
		set: _subject = value
	
	_receivedOn as DateTime		
	[Castle.ActiveRecord.Property] 
	ReceivedOn as DateTime:
		get: return _receivedOn
		set: _receivedOn = value

	_toAccount as Account
	[Castle.ActiveRecord.BelongsTo("accountid")]  
	ToAccount as Account:
		get: return _toAccount
		set: 
			_toAccount = value
			_toAccount.Receipts.Add( self )

	_amount as double
	[Castle.ActiveRecord.Property] 
	Amount as double:
		get: return _amount
		set: _amount = value

	_hasCoveredPlannedIncome as PlannedIncome
	[Castle.ActiveRecord.BelongsTo("incomeid")] 
	HasCoveredPlannedIncome as PlannedIncome:
		get: return _hasCoveredPlannedIncome
		set: _hasCoveredPlannedIncome = value
